﻿using Orchard.Mvc.Routes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Mod.Search
{
    public class Routes : IRouteProvider
    {
        public void GetRoutes(ICollection<RouteDescriptor> routes)
        {
            foreach (var routeDescriptor in GetRoutes())
                routes.Add(routeDescriptor);
        }

        public IEnumerable<RouteDescriptor> GetRoutes()
        {
            yield return
                new RouteDescriptor
                {
                    Priority = 100,
                    Route = new Route(
                        "Search",
                        new RouteValueDictionary {
                                {"area", "Mod.Search"},
                                {"controller", "search"},
                                {"action", "index"}
                            },
                        null,
                        new RouteValueDictionary {
                                {"area", "Mod.Search"}
                            },
                        new MvcRouteHandler())
                };

            yield break;
        }
    }
}